package com.ysg.widget.dialog;

import android.content.Context;
import android.view.View;
import android.widget.TextView;
import com.ysg.R;
import com.ysg.base.BaseDialog;
import com.ysg.utils.YBaseActivityUtil;

/**
 * vip充值
 */
public class VipRechargeDialog extends BaseDialog {
    public VipRechargeDialog(Context context) {
        super(context);
    }
    public VipRechargeDialog(Context context, boolean hasDiamond) {
        super(context);
        this.hasDiamond = hasDiamond;
    }

    private TextView tvConfirm, tvDiamond, tvCancel;
    private boolean hasDiamond;//是否需要充值钻石；默认false

    @Override
    public int getLayoutId() {
        return R.layout.dialog_vip_recharge;
    }

    public void initView() {
        tvConfirm = findViewById(R.id.tvConfirm);
        tvDiamond = findViewById(R.id.tvZuanshi);
        tvCancel = findViewById(R.id.tvCancel);
    }

    @Override
    public void initData() {
        if (hasDiamond){
            tvDiamond.setVisibility(View.VISIBLE);
        }
    }

    @Override
    public void initListener() {
        tvConfirm.setOnClickListener((v)->{
            dismiss();
            YBaseActivityUtil.getInstance().jumpMineVip(getContext());
        });
        tvDiamond.setOnClickListener((v)->{
            dismiss();
            YBaseActivityUtil.getInstance().jumpMineRecharge(getContext());
        });
        tvCancel.setOnClickListener((v)->{
            dismiss();
        });
    }


}
